/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package AppSerializacion;
import java.io.*;
/**
 *
 * @author Usuario
 */
public class Deserealizacion {
    
    public static void main(String[] args){
        
        Agenda a1=null;
        Agenda a2=null;
        
        try{
            //abrir o recuperar un archivo d disco
            FileInputStream fis=new FileInputStream("agenda.ser");
            //stream´para recuperar o reconstruir objetos
            ObjectInputStream ois=new ObjectInputStream(fis);
            //el metodo readObject() recupera el objeto
            a1=(Agenda) ois.readObject();
            a2=(Agenda) ois.readObject();
            ois.close();
            
            
        } catch (FileNotFoundException e){
            e.printStackTrace();
        }catch (IOException e){
            e.printStackTrace();
        } catch (ClassNotFoundException e){
            e.printStackTrace();
        }
        
        System.out.println(a1);
        System.out.println(a2);
                
    }
    
}
